package com.ipet.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ipet.item.pojo.SPUDetail;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface SPUDetailMapper extends BaseMapper<SPUDetail> {
    @Select("select * from tb_spu_detail where spu_id = #{spuId}")
    SPUDetail findById(String spuId);
    @Delete({"<script> delete from  tb_spu_detail  "
            + "WHERE spu_id IN "
            + "<foreach  collection = 'list' item = 'id' index = 'index' open = '(' separator= ',' close = ')' >"
            + "	#{id} "
            + "</foreach>"
            + "</script>"
    })
    Integer deleteSpuBatch(List<String> list);
}
